import { apdeviceRequest } from "@/utils/request";

export const listAPI = '/listCamera';

export const addDevice = async (data: object) => {
  return await apdeviceRequest('/camera', {
    method: 'POST',
    data: data,
  });
};

export const deleteDevice = async (id: number) => {
  return await apdeviceRequest(`/camera/${id}`, {
    method: 'DELETE',
  });
};

export const updateDevice = async (data: object) => {
  return await apdeviceRequest(`/camera`, {
    method: 'PATCH',
    data: data,
  });
};

export const getDevice = async (id: number) => {
  return await apdeviceRequest(`/camera/${id}`, {
    method: 'GET',
  });
};
